// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MessageBoxHelpers.cs" company="Roman '4ux-nbIx' Novitsky">
//   Copyright (c) Roman '4ux-nbIx' Novitsky 2010
// </copyright>
// <summary>
//   Defines the MessageBoxHelpers type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TaskbarButtons
{
  #region Namespace Imports

  using System;
  using System.Diagnostics.CodeAnalysis;
  using System.Windows.Forms;

  #endregion


  /// <summary>
  /// Describes and manipulates the message box helpers.
  /// </summary>
  public static class MessageBoxHelpers
  {
    #region Public Methods

    /// <summary>
    /// Shows the error.
    /// </summary>
    /// <param name="windowHandle">
    /// The window handle.
    /// </param>
    /// <param name="text">
    /// The error text.
    /// </param>
    /// <param name="caption">
    /// The caption.
    /// </param>
    [SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions", Justification = "Cannot do this.")]
    public static void ShowError(IntPtr windowHandle, string text, string caption)
    {
      NativeWindow window = NativeWindow.FromHandle(windowHandle);

      MessageBox.Show(
        window, text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
    }

    #endregion
  }
}